home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / AEGestalt 1.0 / ULabelView.cp < prev    next >
Encoding:
Text File  |  1992-07-15  |  2.5 KB  |  93 lines  |  [TEXT/MPS ]

  1. //     ULabelView.cp 
  2. //     Copyright © 1991-92 by Apple Computer, Inc. All rights reserved.
  3. //    Kent Sandvik DTS
  4. //    This file contains all the member functions for TLabelView, i.e.
  5. //    it handles the drawing of the TLabelView view.
  6. //
  7. //    <1>        khs        1.0        First final version
  8.  
  9.  
  10. #ifndef __LABELVIEW__  
  11. #include "ULabelView.h" 
  12. #endif
  13.  
  14. //    Empty constructor - for avoiding ptabs in global data space
  15. #pragma segment ARes
  16. TLabelView::TLabelView()
  17. {
  18. }
  19.  
  20.  
  21. #pragma segment AInit
  22. pascal void TLabelView::Initialize()
  23. {
  24.     inherited::Initialize();
  25.  
  26.     //    create all the label strings, yes, this would be far better if we
  27.     //    loaded them in from STR# resources, and maybe we will do this in the
  28.     //    next improved version (and charge $99 for the 1.1 release)
  29.     fLabel1 = "• Machine type:";
  30.     fLabel2 = "• System Version:";
  31.     fLabel3 = "• Processor Type:";
  32.     fLabel4 = "• Has FPU?";
  33.     fLabel5 = "• Has Color Quickdraw?";
  34.     fLabel6 = "• Has 32-bit Quickdraw?";
  35.     fLabel7 = "• Has SCSI?";
  36.     fLabel8 = "• Has Apple Event Mgr?";
  37.     fLabel9 = "• Has EditionMgr?";
  38.     fLabel10 = "• Is A/UX system?";
  39.     fLabel11 = "• Has TrueType?";
  40.     fLabel12 = "• AppleTalk driver no:";
  41. }
  42.  
  43.  
  44. //    Draw the information contained in the drawing object field to screen
  45. #pragma segment ARes
  46. pascal void TLabelView::Draw(const VRect& area)
  47. {
  48.     inherited::Draw(area);
  49.     // draw the real thing!
  50.     this->DrawLabels();
  51. }
  52.  
  53.  
  54. #pragma segment ARes
  55. pascal void TLabelView::DrawLabels()
  56. {
  57.     // Set font and font size
  58.     PenNormal();
  59.     TextFont(geneva);
  60.     TextSize(9);
  61.  
  62.     // Draw Labels
  63.     MoveTo(kHorizontStart, kVerticalStart);
  64.     DrawString(fLabel1);
  65.     MoveTo(kHorizontStart, kVerticalStart + kVerticalOffset);
  66.     DrawString(fLabel2);
  67.     MoveTo(kHorizontStart, kVerticalStart + 2 * kVerticalOffset);
  68.     DrawString(fLabel3);
  69.     MoveTo(kHorizontStart, kVerticalStart + 3 * kVerticalOffset);
  70.     DrawString(fLabel4);
  71.     MoveTo(kHorizontStart, kVerticalStart + 4 * kVerticalOffset);
  72.     DrawString(fLabel5);
  73.     MoveTo(kHorizontStart, kVerticalStart + 5 * kVerticalOffset);
  74.     DrawString(fLabel6);
  75.     MoveTo(kHorizontStart, kVerticalStart + 6 * kVerticalOffset);
  76.     DrawString(fLabel7);
  77.     MoveTo(kHorizontStart, kVerticalStart + 7 * kVerticalOffset);
  78.     DrawString(fLabel8);
  79.     MoveTo(kHorizontStart, kVerticalStart + 8 * kVerticalOffset);
  80.     DrawString(fLabel9);
  81.     MoveTo(kHorizontStart, kVerticalStart + 9 * kVerticalOffset);
  82.     DrawString(fLabel10);
  83.     MoveTo(kHorizontStart, kVerticalStart + 10 * kVerticalOffset);
  84.     DrawString(fLabel11);
  85.     MoveTo(kHorizontStart, kVerticalStart + 11 * kVerticalOffset);
  86.     DrawString(fLabel12);
  87.  
  88.     // restore pen
  89.     PenNormal();
  90. }
  91.  
  92.  
  93.